<template>
  <div class="li-window" :style="style_border">
    <div class="li-window__header" :style="style_bg">
      <span class="li-window__title">{{title}}</span>
      <div class="li-window__count">{{count}}</div>
    </div>
    <div class="li-window__body">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Window',
  props: {
    title: String,
    count: {
      type: Number,
      default: 0
    },
    color: {
      type: String,
      default: '#deddde'
    }
  },
  computed: {
    style_border () {
      return {
        border: `2px solid ${this.color}`
      }
    },
    style_bg () {
      return {
        backgroundColor: `${this.color}`
      }
    }
  }
}
</script>

<style lang="scss">
$border-radius: 5px;
.li-window {
  border-radius: $border-radius;
  min-width: 200px;
  &__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30px;
    padding: 0 8px;
  }
  &__title,
  &__count {
    font-size: 16px;
    color: #666;
    font-weight: 700;
  }
  &__body {
    padding: 8px;
  }
}
</style>
